package LeeJS;
public class J12_Gugudan {
	
	
	
	public static void main(String[] args) {
		
		//문제1 : while 문을 이용해서 3단을 출력
		
		int a = 3;
		int b = 1;
		
		System.out.println("3단을 출력합니다.");
		
		while(b <= 9){
			
			System.out.println(a * b);
			
			b++;
			
		}
		// 교수님께서 적어주신 정답(?)
		int i = 1;
		
		System.out.println("3단을 출력합니다");
		
		while(i <= 9){
			
			System.out.println("3 x " + i + "=" + (3 * i));
			++i;
		}
		
		//문제2 : do-while 문을 이용해서 7단을 출력
		
		int c = 7;
		int d = 1;
		
		System.out.println("7단을 출력합니다.");
		
		do{
			
			System.out.println(c * d);
			
			++d;
			
		}while(d != 10);
		
		
		// 교수님께서 적어주신 정답(?)
		
		int j = 1;
		
		System.out.println("7단을 출력합니다");
		
		do{
			
			System.out.println("7 x " + j + " = " + (7*j));
			
			j++;
			
		}while(j <= 9);
		
		//문제3 : for 문을 이용해서 9단을 출력
		
		int f = 1;
		int go = 0;
		
		System.out.println("9단을 출력합니다.");
		
		for(int e = 9; f <= 9; f++){
			
			go = e * f;
			
			System.out.println(go);
		}
		
		// 교수님께서 적어주신 정답(?)
		
		System.out.println("9단을 출력합니다.");
		
		for(int k = 1; k <= 9; ++k){
			
			System.out.println("9 x " + k + " = " + (9*k));
			
		}
		
		System.out.println("				Multiplication Table");
		
		System.out.println("		1       2       3       4       5       6       7       8       9");
		
		System.out.println("---------------------------------------------------------------------------------");
		
		System.out.println("1       |       1       2       3       4       5       6       7       8       9");
		
		System.out.println("2       |       2       4       6       8      10      12      14      16      18");
		
		System.out.println("3       |       3       6       9      12      15      18      21      24      27");
		
		System.out.println("4       |       4       8      12      16      20      24      28      32      36");
		
		System.out.println("5       |       5      10      15      20      25      30      35      40      45");
		
		System.out.println("6       |       6      12      18      24      30      36      42      48      54");
		
		System.out.println("7       |       7      14      21      28      35      42      49      56      63");
		
		System.out.println("8       |       8      16      24      32      40      48      56      64      72");
		
		System.out.println("9       |       9      18      27      36      45      54      63      72      81");
		
		for(int v = 1; v <= 9; v++){
			
			if(v == 1)System.out.print(v + "       |");
			System.out.print("       " + v);
			
		}
		System.out.println();
		for(int v = 1; v <= 9; v++){
			
			if(v == 1)System.out.print("2" + "       |");
			System.out.print("       " + (2 * v));
		}
		
		System.out.println();
		
		for(int v = 1; v <= 9; v++){
			
			if(v == 1)System.out.print("3" + "       |");
			System.out.print("       " + (3 * v));
			
		}
		
		System.out.println();
		
		for(int v = 1; v <= 9; v++){
			
			if(v == 1)System.out.print("4" + "       |");
			System.out.print("       " + (4 * v));
			
		}
		
		System.out.println();
		
		for(int v = 1; v <= 9; v++){
			
			if(v == 1)System.out.print("5" + "       |");
			System.out.print("       " + (5 * v));
			
		}
		
		System.out.println();
		
		for(int v = 1; v <= 9; v++){
			
			if(v == 1)System.out.print("6" + "       |");
			System.out.print("       " + (6 * v));
			
		}
		
		System.out.println();
		
		for(int v = 1; v <= 9; v++){
			
			if(v == 1)System.out.print("7" + "       |");
			System.out.print("       " + (7 * v));
			
		}
		
		System.out.println();
		
		for(int v = 1; v <= 9; v++){
			
			if(v == 1)System.out.print("8" + "       |");
			System.out.print("       " + (8 * v));
			
		}
		
		System.out.println();
		
		for(int v = 1; v <= 9; v++){
			
			if(v == 1)System.out.print("9" + "       |");
			System.out.print("       " + (9 * v));
			
		}
		
		System.out.println();
		
		for(int x = 1; x <= 9; ++x){
			
		for(int v = 1; v <= 9; ++v){
			
			if(v == 1)System.out.print(x + "       |");
			
			System.out.print("\t" + (x * v));
			
			}
		System.out.println();
		}
		
	}
	
}